function er=maproots(r,s)

if isempty(r),
    return;
end;

nr=length(r);
rv=exp(2*1i*pi*(0:(s-1))/s);
dif=abs(r*ones(1,s)-ones(nr,1)*rv);
[md, assig]=min(dif,[],2);

er=rv(assig);
